import org.junit.Test;

public class 作业 {
@Test
public void testlength() {
String str = "Hello Java";
System.out.println(str.length());
char c=str.charAt(4);
System.out.println(c);
int index = str.indexOf('o');
if (index != -1) {
String subStr = str.substring(index);
System.out.println(subStr); }
str=str.substring(0,5);
System.out.println(str);
str=str.substring(6);
System.out.println(str);
String trimmedStr = str.trim();
System.out.println(trimmedStr);
char charAtIndex6 = str.charAt(6);
System.out.println(charAtIndex6);
str=str.trim().toUpperCase();
System.out.println(str);
str=str.trim().toLowerCase();
}
}</html>